package domain.entities;// default package

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * Cities entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "cities", catalog = "bms")
public class Cities implements java.io.Serializable, Comparable<Cities> {

	// Fields

	private Integer cityId;
	private String countryId;
	private String regionId;
	private String city;
	private Float latitude;
	private Float longitude;
	private String timeZone;
	private Short dmaId;
	private String county;
	private String code;

	// Constructors

	/** default constructor */
	public Cities() {
	}

	/** minimal constructor */
	public Cities(String countries, String regions, String city,
			Float latitude, Float longitude, String timeZone) {
		this.countryId = countries;
		this.regionId = regions;
		this.city = city;
		this.latitude = latitude;
		this.longitude = longitude;
		this.timeZone = timeZone;
	}

	/** full constructor */
	public Cities(String countries, String regions, String city,
			Float latitude, Float longitude, String timeZone, Short dmaId,
			String county, String code) {
		this.countryId = countries;
		this.regionId = regions;
		this.city = city;
		this.latitude = latitude;
		this.longitude = longitude;
		this.timeZone = timeZone;
		this.dmaId = dmaId;
		this.county = county;
		this.code = code;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "CityId", unique = true, nullable = false)
	public Integer getCityId() {
		return this.cityId;
	}

	public void setCityId(Integer cityId) {
		this.cityId = cityId;
	}

	@Column(name = "CountryID")
	public String getCountries() {
		return this.countryId;
	}

	public void setCountries(String countries) {
		this.countryId = countries;
	}

	@Column(name = "RegionID", nullable = false)
	public String getRegions() {
		return this.regionId;
	}

	public void setRegions(String regions) {
		this.regionId = regions;
	}

	@Column(name = "City", nullable = false, length = 45)
	public String getCity() {
		return this.city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	@Column(name = "Latitude",  precision = 12, scale = 0)
	public Float getLatitude() {
		return this.latitude;
	}

	public void setLatitude(Float latitude) {
		this.latitude = latitude;
	}

	@Column(name = "Longitude", precision = 12, scale = 0)
	public Float getLongitude() {
		return this.longitude;
	}

	public void setLongitude(Float longitude) {
		this.longitude = longitude;
	}

	@Column(name = "TimeZone",  length = 10)
	public String getTimeZone() {
		return this.timeZone;
	}

	public void setTimeZone(String timeZone) {
		this.timeZone = timeZone;
	}

	@Column(name = "DmaId")
	public Short getDmaId() {
		return this.dmaId;
	}

	public void setDmaId(Short dmaId) {
		this.dmaId = dmaId;
	}

	@Column(name = "County", length = 25)
	public String getCounty() {
		return this.county;
	}

	public void setCounty(String county) {
		this.county = county;
	}

	@Column(name = "Code", length = 4)
	public String getCode() {
		return this.code;
	}

	public void setCode(String code) {
		this.code = code;
	}

    @Override
    public int compareTo(Cities o) {
        return this.city.toLowerCase().compareTo(o.getCity().toLowerCase());
    }
}